<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   主题：有没有用 R 和 openstreetmap 做地图的？  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({elements: ["bbpress-forums"]});
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/cn/topic/158132/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466450899: Accept with keywords: (title(0.0):主题,地图,论坛, topn(0.233333333333):中心,帖子,标识,会员,倍数,玩游戏,用户名,文档,参数,图片,语句,错位,函数,次数,普通,字符串,图片尺寸,百度,关系,理想,极大,密码,代码,主题,地图,论坛,维度,平面,好友,讨论区).-->
 </head>
 <body class="topic bbpress single single-topic postid-158132 single-author sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    主题：有没有用 R 和 openstreetmap 做地图的？
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/cn">
       <img src="http://cos.name/cn/wp-content/themes/COS-forest/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <div class="menu-%e8%8f%9c%e5%8d%951-container">
        <ul class="nav-menu" id="menu-%e8%8f%9c%e5%8d%951">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-407772" id="menu-item-407772">
          <a href="http://cos.name/cn/">
           论坛首页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407773" id="menu-item-407773">
          <a href="http://cos.name/cn/forums/">
           讨论区
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407774" id="menu-item-407774">
          <a href="http://cos.name/cn/wp-login.php?action=register">
           注册
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407819" id="menu-item-407819">
          <a href="http://cos.name/">
           主站
          </a>
         </li>
        </ul>
       </div>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-158132 topic type-topic status-publish hentry" id="post-158132">
        <header class="entry-header">
         <h1 class="entry-title">
          有没有用 R 和 openstreetmap 做地图的？
         </h1>
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <div id="bbpress-forums">
          <div class="bbp-breadcrumb">
           <p>
            <a class="bbp-breadcrumb-home" href="http://cos.name/cn/">
             COS论坛 | 统计之都
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-root" href="http://cos.name/cn/forums/">
             讨论区
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/">
             软件应用
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/r-language/">
             S-Plus &amp; R语言
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <span class="bbp-breadcrumb-current">
             有没有用 R 和 openstreetmap 做地图的？
            </span>
           </p>
          </div>
          <div class="bbp-template-notice info">
           <p class="bbp-topic-description">
            该主题包含 7 条回复，5个帖子，最后由
            <a class="bbp-author-avatar" href="http://cos.name/cn/profile/370488/" rel="nofollow" title="查看earclimate的档案">
             <img src="http://sdn.geekzu.org/avatar/bed5da0112cbf51999921ce7f7ad1808?s=14&amp;d=monsterid&amp;r=g"/>
            </a>
            <a class="bbp-author-name" href="http://cos.name/cn/profile/370488/" rel="nofollow" title="查看earclimate的档案">
             earclimate
            </a>
            在
            <a href="http://cos.name/cn/topic/158132/#post-407491" title="回复：有没有用 R 和 openstreetmap 做地图的？">
             1 年, 8 月 之前
            </a>
            更新。
           </p>
          </div>
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 8 个帖子 - 1 到 8（总计 8 个）
           </div>
           <div class="bbp-pagination-links">
           </div>
          </div>
          <ul class="forums bbp-replies" id="topic-158132-replies">
           <li class="bbp-header">
            <div class="bbp-reply-author">
             作者
            </div>
            <!-- .bbp-reply-author -->
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-header -->
           <li class="bbp-body">
            <div class="bbp-reply-header" id="post-158132">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年8月30日 下午3:35
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/158132/#post-158132">
               1 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-158132 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-158132 bbp-reply-position-1 user-id-14231 topic-author post-158132 topic type-topic status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               <img src="http://sdn.geekzu.org/avatar/8e992f119108ddb2f6238c88c569fa0d?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               jiangshq
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               自从 google 不能使用后，最近在研究 openstreetmap，有没有用 R 和 openstreetmap 做地图的高手，对 osmar 这个包比较熟悉的，求指点。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-406385">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年9月14日 上午6:46
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/158132/#post-406385">
               2 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-406385 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-158132 bbp-reply-position-2 user-id-380181 post-406385 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/380181/" rel="nofollow" title="查看wfldragon的档案">
               <img src="http://sdn.geekzu.org/avatar/03fc50cb6357344ffe49e2e689bccd2e?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/380181/" rel="nofollow" title="查看wfldragon的档案">
               wfldragon
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               之前用R和googlemap作图时发现参数不够灵活，用Openstreet搞过。可以参考帖子：http://bbs.pinggu.org/forum.php?mod=viewthread&amp;tid=2992461&amp;page=2#pid24600201
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-406405">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年9月15日 上午1:23
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/158132/#post-406405">
               3 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-406405 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-158132 bbp-reply-position-3 user-id-374916 post-406405 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/374916/" rel="nofollow" title="查看nuomin的档案">
               <img src="http://sdn.geekzu.org/avatar/244783f35fc121c3d155f69abbf448f6?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/374916/" rel="nofollow" title="查看nuomin的档案">
               nuomin
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               能保证网络畅通吗？因为网络不通，放弃RGoogleMap包了
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-406419">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年9月15日 上午11:33
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/158132/#post-406419">
               4 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-406419 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-158132 bbp-reply-position-4 user-id-392669 post-406419 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/392669/" rel="nofollow" title="查看libingfei的档案">
               <img src="http://sdn.geekzu.org/avatar/480b3e74aded240ff746dba165e8189a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/392669/" rel="nofollow" title="查看libingfei的档案">
               libingfei
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               9月16日修正2,挡横纵坐标不一致时地图会出现错位。
               <br/>
               ggmap的百度和谷歌地图维度相反导致。
               <br/>
               需要修改输出map维度，
               <br/>
               函数最后增加语句如下：
              </p>
              <pre class="highlight ">#t(map)
 map&lt;-t(map)
  dim(map)&lt;-c(size[2],size[1])
  map
</pre>
              <p>
              </p>
              <p>
               9月16日修正，今天测试时发现Google是球形坐标变换，百度是平面坐标变换。
               <br/>
               使用get_googlemap还需要修改坐标变换公式
               <br/>
               替换语句如下：
              </p>
              <pre class="highlight "> #修改六，发现谷妹度嫂的坐标变换关系不一致
  #我采集了一些点分析百度坐标的变换做关系测试，发现度嫂的坐标变换极大可能是平面变换。。。。
  ll &lt;- center-c(2.3552/2^zoom * size[1]/2,1.814528/2^zoom * size[2]/2)
  ur &lt;- center+c(2.3552/2^zoom * size[1]/2,1.814528/2^zoom * size[2]/2)
  #ll &lt;- XY2LatLon(list(lat = center[2], lon = center[1], zoom = zoom-1),
  #                -size[1]/2 + 0.5, -size[2]/2 - 0.5)
  #ur &lt;- XY2LatLon(list(lat = center[2], lon = center[1], zoom = zoom-1),
   #               size[1]/2 + 0.5, size[2]/2 - 0.5)
</pre>
              <p>
              </p>
              <p>
               回复 第1楼 的 jiangshq：我找了好久楼主说的osmar没找到啊。
               <br/>
               google我不在教育网用不了。
               <br/>
               openstreetmap我每天貌似只能由20次左右，就提示我服务器繁忙，一旦提示就一天用不了。
               <br/>
               根据实际使用经验，我个人认为openstreetmap要比google和百度好(google和百度差不多档次)
               <br/>
               无奈只能用度嫂。
               <br/>
               最容易使用度嫂地图的方法是修改：
               <br/>
               ggmap中的get_googlemap
              </p>
              <p>
               按照如下的修改,同时使用zoom和size会产生冲突图像错位,故只能选择其中一个使用。
              </p>
              <p>
               效果如下：
               <br/>
               <img src="http://s12.sinaimg.cn/mw690/0019DazBzy6M46pjksX8b&amp;690"/>
              </p>
              <p>
               图片看不到可以这里
               <br/>
               <a href="http://blog.sina.com.cn/s/blog_3f16beff0102v3ed.html" rel="nofollow">
                http://blog.sina.com.cn/s/blog_3f16beff0102v3ed.html
               </a>
               <br/>
               因为这两个地图很相似所以，只要稍加修该就可以读度嫂的图。
              </p>
              <p>
               修改后源码如下：
              </p>
              <pre class="highlight ">getdumap&lt;-function (center = c(lon = -95.3632715, lat = 29.7632836),
                    zoom = 10,
                    size = c(640, 640),
                    scale = 2,
                    format = c("png8", "gif", "jpg", "jpg-baseline", "png32"),
                    maptype = c("terrain","satellite", "roadmap", "hybrid"),
                    language = "en-EN", region, markers, path, visible, style,
                    sensor = FALSE, messaging = FALSE,
                    urlonly = FALSE, filename = "ggmapTemp",
                    color = c("color", "bw"), ...)
{
  #读取字符串
  args &lt;- as.list(match.call(expand.dots = TRUE)[-1])
  argsgiven &lt;- names(args)
  #中心判别
  if ("center" %in% argsgiven) {
    if (!((is.numeric(center) &amp;&amp; length(center) == 2) ||
            (is.character(center) &amp;&amp; length(center) == 1))) {
      stop("center of map misspecified, see ?get_googlemap.",
           call. = F)
    }
    if (all(is.numeric(center))) {
      lon &lt;- center[1]
      lat &lt;- center[2]
      if (lon &lt; -180 || lon &gt; 180) {
        stop("longitude of center must be between -180 and 180 degrees.",
             " note ggmap uses lon/lat, not lat/lon.", call. = F)
      }
      if (lat &lt; -90 || lat &gt; 90) {
        stop("latitude of center must be between -90 and 90 degrees.",
             " note ggmap uses lon/lat, not lat/lon.", call. = F)
      }
    }
  }
  #放大倍数判别
  if ("zoom" %in% argsgiven) {
    if (!(is.numeric(zoom) &amp;&amp; zoom == round(zoom) &amp;&amp; zoom &gt;
            0)) {
      stop("zoom must be a whole number between 1 and 21",
           call. = F)
    }
  }
  #图片尺寸
  if ("size" %in% argsgiven) {
    stopifnot(all(is.numeric(size)) &amp;&amp; all(size == round(size)) &amp;&amp;
                all(size &gt; 0))
  }
  #图片精细度
  if ("scale" %in% argsgiven) {
    stopifnot(scale %in% c(1, 2, 4))
  }
  #标注
  if ("markers" %in% argsgiven) {
    markers_stop &lt;- TRUE
    if (is.data.frame(markers) &amp;&amp; all(apply(markers[, 1:2],
                                            2, is.numeric)))
      markers_stop &lt;- FALSE
    if (class(markers) == "list" &amp;&amp; all(sapply(markers, function(elem) {
      is.data.frame(elem) &amp;&amp; all(apply(elem[, 1:2], 2,
                                       is.numeric))
    })))
      markers_stop &lt;- FALSE
    if (is.character(markers) &amp;&amp; length(markers) == 1)
      markers_stop &lt;- FALSE
    if (markers_stop)
      stop("improper marker specification, see ?get_googlemap.",
           call. = F)
  }
  #折现标注
  if ("path" %in% argsgiven) {
    path_stop &lt;- TRUE
    if (is.data.frame(path) &amp;&amp; all(apply(path[, 1:2], 2,
                                         is.numeric)))
      path_stop &lt;- FALSE
    if (class(path) == "list" &amp;&amp; all(sapply(path, function(elem) {
      is.data.frame(elem) &amp;&amp; all(apply(elem[, 1:2], 2,
                                       is.numeric))
    })))
      path_stop &lt;- FALSE
    if (is.character(path) &amp;&amp; length(path) == 1)
      path_stop &lt;- FALSE
    if (path_stop)
      stop("improper path specification, see ?get_googlemap.",
           call. = F)
  }
  #出现此标识推出
  if ("visible" %in% argsgiven) {
    message("visible argument untested.")
    visible_stop &lt;- TRUE
    if (is.data.frame(visible) &amp;&amp; all(apply(visible[, 1:2],
                                            2, is.numeric)))
      visible_stop &lt;- FALSE
    if (is.character(visible))
      visible_stop &lt;- FALSE
    if (visible_stop)
      stop("improper visible specification, see ?get_googlemap.",
           call. = F)
  }
  #地图类型
  if ("style" %in% argsgiven) {
    message("style argument untested.")
    style_stop &lt;- TRUE
    if (is.character(style) &amp;&amp; length(style) == 1)
      style_stop &lt;- FALSE
    if (style_stop)
      stop("improper style specification, see ?get_googlemap.",
           call. = F)
  }
  if ("sensor" %in% argsgiven)
    stopifnot(is.logical(sensor))
  if ("messaging" %in% argsgiven)
    stopifnot(is.logical(messaging))
  if ("urlonly" %in% argsgiven)
    stopifnot(is.logical(urlonly))
  if ("filename" %in% argsgiven) {
    filename_stop &lt;- TRUE
    if (is.character(filename) &amp;&amp; length(filename) == 1)
      filename_stop &lt;- FALSE
    if (filename_stop)
      stop("improper filename specification, see ?get_googlemap.",
           call. = F)
  }
  if ("checkargs" %in% argsgiven) {
    .Deprecated(msg = "checkargs argument deprecated, args are always checked after v2.1.")
  }
  format &lt;- match.arg(format)
  if (format != "png8")
    stop("currently only the png format is supported.", call. = F)
  maptype &lt;- match.arg(maptype)
  color &lt;- match.arg(color)
  if (!missing(markers) &amp;&amp; class(markers) == "list")
    markers &lt;- plyr:::list_to_dataframe(markers)
  if (!missing(path) &amp;&amp; is.data.frame(path))
    path &lt;- list(path)
  #修改1：开始连接变量
  base_url &lt;- "http://api.map.baidu.com/staticimage?"
  center_url &lt;- if (all(is.numeric(center))) {
    center &lt;- round(center, digits = 6)
    lon &lt;- center[1]
    lat &lt;- center[2]
    #修改4
    paste("center=", paste(lon , lat, sep = ","), sep = "")
  }
  else {
    centerPlus &lt;- gsub(" ", "+", center)
    paste("center=", centerPlus, sep = "")
  }
  zoom_url &lt;- paste("zoom=", zoom, sep = "")
  #修改2
  size_url &lt;- paste(paste("height=",size[2],sep=""),paste("width=",size[1],sep=""),sep="&amp;")
  scale_url &lt;- if (!missing(scale)) {
    paste("scale=", scale)
  }
  else {
    ""
  }
  format_url &lt;- if (!missing(format) &amp;&amp; format != "png8") {
    paste("format=", format)
  }
  else {
    ""
  }
  maptype_url &lt;- paste("maptype=", maptype, sep = "")
  language_url &lt;- if (!missing(language)) {
    paste("language=", language)
  }
  else {
    ""
  }
  region_url &lt;- if (!missing(region)) {
    paste("region=", region)
  }
  else {
    ""
  }
  markers_url &lt;- if (!missing(markers)) {
    if (is.data.frame(markers)) {
      paste("markers=", paste(apply(markers, 1, function(v) paste(rev(round(v,6)), collapse = ",")), collapse = "|"), sep = "")
    }
    else {
      paste("markers=", markers, sep = "")
    }
  }
  else {
    ""
  }
  path_url &lt;- if (!missing(path)) {
    if (is.list(path)) {
      ps &lt;- sapply(path, function(one_path) {
        paste("path=", paste(apply(one_path, 1, function(v) paste(rev(round(v,6)), collapse = ",")), collapse = "|"), sep = "")
      })
      paste(ps, collapse = "&amp;")
    }
    else {
      paste("path=", path, sep = "")
    }
  }
  else {
    ""
  }
  visible_url &lt;- if (!missing(visible)) {
    if (is.data.frame(visible)) {
      paste("visible=", paste(apply(visible, 1, function(v) paste(rev(round(v,6)), collapse = ",")), collapse = "|"), sep = "")
    }
    else {
      paste("visible=", paste(visible, collapse = "|"),
            sep = "")
    }
  }
  else {
    ""
  }
  style_url &lt;- if (!missing(style)) {
    paste("style=", style)
  }
  else {
    ""
  }
  sensor_url &lt;- paste("sensor=", tolower(as.character(sensor)),
                      sep = "")
  #修改3
  post_url &lt;- paste(center_url, zoom_url, size_url, scale_url,
                    format_url, language_url, region_url, markers_url,
                    path_url, visible_url, style_url, sep = "&amp;")
  url &lt;- paste(base_url, post_url, sep = "")
  url &lt;- gsub("[&amp;]+", "&amp;", url)
  if (substr(url, nchar(url), nchar(url)) == "&amp;") {
    url &lt;- substr(url, 1, nchar(url) - 1)
  }
  url &lt;- URLencode(url)
  if (urlonly)
    return(url)
  if (nchar(url) &gt; 2048)
    stop("max url length is 2048 characters.", call. = FALSE)
  destfile &lt;- if (format %in% c("png8", "png32")) {
    paste(filename, "png", sep = ".")
  }
  else if (format %in% c("jpg", "jpg-baseline")) {
    paste(filename, "jpg", sep = ".")
  }
  else {
    paste(filename, "gif", sep = ".")
  }
  download.file(url, destfile = destfile, quiet = !messaging,
                mode = "wb")
  message(paste0("Map from URL : ", url))
  message("Google Maps API Terms of Service : &lt;a href="http://developers.google.com/maps/terms" rel="nofollow"&gt;http://developers.google.com/maps/terms&lt;/a&gt;")
  map &lt;- readPNG(destfile)
  if (color == "color") {
    map &lt;- apply(map, 2, rgb)
  }
  else if (color == "bw") {
    mapd &lt;- dim(map)
    map &lt;- gray(0.3 * map[, , 1] + 0.59 * map[, , 2] + 0.11 *
                  map[, , 3])
    dim(map) &lt;- mapd[1:2]
  }
  class(map) &lt;- c("ggmap", "raster")
  if (is.character(center))
    center &lt;- as.numeric(geocode(center))
  #修改六，发现谷妹度嫂的坐标变换关系不一致
  #我采集了一些点分析百度坐标的变换关系测试，发现度嫂的坐标变换极大可能是平面变换。。。。
  ll &lt;- center-c(2.3552/2^zoom * size[1]/2,1.814528/2^zoom * size[2]/2)
  ur &lt;- center+c(2.3552/2^zoom * size[1]/2,1.814528/2^zoom * size[2]/2)
  #ll &lt;- XY2LatLon(list(lat = center[2], lon = center[1], zoom = zoom-1),
  #                -size[1]/2 + 0.5, -size[2]/2 - 0.5)
  #ur &lt;- XY2LatLon(list(lat = center[2], lon = center[1], zoom = zoom-1),
   #               size[1]/2 + 0.5, size[2]/2 - 0.5)
  attr(map, "bb") &lt;- data.frame(ll.lat = ll[2], ll.lon = ll[1],
                             ur.lat = ur[2], ur.lon = ur[1])
  #修改七
  map&lt;-t(map)
  dim(map)&lt;-c(size[2],size[1])
  map
}
</pre>
              <p>
              </p>
              <div class="bbp-signature">
               <p>
                请加加PSN游戏好友。
                <br/>
                PSN:libingfei
                <br/>
                我有理想，我的理想是随时可以玩游戏。
               </p>
              </div>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-406594">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年9月19日 上午3:13
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/158132/#post-406594">
               5 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-406594 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-158132 bbp-reply-position-5 user-id-380181 post-406594 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/380181/" rel="nofollow" title="查看wfldragon的档案">
               <img src="http://sdn.geekzu.org/avatar/03fc50cb6357344ffe49e2e689bccd2e?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/380181/" rel="nofollow" title="查看wfldragon的档案">
               wfldragon
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               回复 第3楼 的 nuomin：我在香港这边试过，效果还是可以的。访问次数不多，暂时没碰到受限的情况。之前看到Google Map每天的访问次数是2500，Openstreet应该不止这么多次，只是地理解码的话好像yahoo的地图完全没有次数限制。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-407460">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年10月21日 上午8:18
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/158132/#post-407460">
               6 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407460 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-158132 bbp-reply-position-6 user-id-14231 topic-author post-407460 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               <img src="http://sdn.geekzu.org/avatar/8e992f119108ddb2f6238c88c569fa0d?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               jiangshq
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               回复 第4楼 的 libingfei：你好，感谢你的回复，你的代码我试了一下，出现问题：&gt; map&lt;-dubigmap(lgsize=3)
               <br/>
               Error in dubigmap(lgsize = 3) : object ‘size’ not found。关于R读取百度地图的方法，我很感兴趣，有没有相关的材料可以共享。谢谢。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-407462">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年10月21日 上午9:04
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/158132/#post-407462">
               7 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407462 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-158132 bbp-reply-position-7 user-id-392669 post-407462 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/392669/" rel="nofollow" title="查看libingfei的档案">
               <img src="http://sdn.geekzu.org/avatar/480b3e74aded240ff746dba165e8189a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/392669/" rel="nofollow" title="查看libingfei的档案">
               libingfei
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               回复 第6楼 的 jiangshq：这个代码是初期写的有些问题，其实坐标变换和代码都有点问题后来有修正
              </p>
              <p>
               之前发的那个版本dubigmap中缺少一个size赋值：
              </p>
              <p>
               getdumap函数：是获取百度地图，并且利用谷歌的坐标变换（目前坐标已经较准确了），将其坐标关系映射到百度地图上，等价于原来那个获取谷歌地图的函数，不过目前有用的只有center（中心坐标） , zoom（放大倍数）,size（图形尺寸）这三个参数，其他的还没添加。
               <br/>
               dubigmap函数：是将小地图500*500拼接成任意大小分辨率的地图。现在只写了拼接算法，可拼接数量之只能是奇数级的。调用getdumap获取的坐标映射是准确的，所以，可以截除较大的图后，利用经纬坐标切割成自己想要的。
               <br/>
               三个参数：center(地图中心)；zoom（放大倍数）；lgsize（地图尺寸）
               <br/>
               lgsize=1时，500*500，一张图
               <br/>
               lgsize=2时，1500*1500，9张图
               <br/>
               lgsize=3时，2500*2500，25张图
               <br/>
               。。。。。。。
               <br/>
               目前尚加入自动预防读图错误机制。下载过程中一张图错误都会导致函数崩溃。[s:12]（原计划加上，不过后来在研究别的就忘了）
              </p>
              <p>
               最新的dubigmap、getdumap代码如下：
              </p>
              <pre class="highlight ">dubigmap&lt;-function(center=c(116.403874,39.914888),zoom=15,lgsize=2){
  #缺了这句
  size&lt;-c(500,500)
  des&lt;-c(2.3313056/2^zoom * size[1], 1.86832416/2^zoom * size[2])
  #map&lt;-vector("list",(lgsize*2-1)^2)
  #map&lt;-getdumap(center=c(116.403874,39.914888),zoom,size)
  for(i in 1:(lgsize*2-1)){
    for(j in 1:(lgsize*2-1)){
      maptmp&lt;-getdumap(center +c(des[1],des[2])*c(i-lgsize,j-lgsize),zoom,size)
      if(j==1){
        if(i==1){
          xmin &lt;- attr(maptmp, "bb")$ll.lon
          ymin &lt;- attr(maptmp, "bb")$ll.lat
        }
        maplat&lt;-maptmp
      }else{
        maplat&lt;-cbind(maptmp,maplat)
      }
    }
    if(i==1){
      map&lt;-maplat
    }else{
      map&lt;-rbind(map,maplat)
    }
  }
  xmax &lt;- attr(maptmp, "bb")$ur.lon
  ymax &lt;- attr(maptmp, "bb")$ur.lat
  class(map) &lt;- c("ggmap", "raster")
  attr(map, "bb") &lt;- data.frame(ll.lat = ymin, ll.lon = xmin,ur.lat = ymax, ur.lon = xmax)
  map
  #map2&lt;-getdumap(center=c(116.403874,39.914888)+c(des[1],0),zoom,size)
}
</pre>
              <p>
              </p>
              <p>
               最新后的getdumap函数如下：
              </p>
              <pre class="highlight ">getdumap&lt;-function (center = c(lon = -95.3632715, lat = 29.7632836),
                    zoom = 10,
                    size = c(640, 640),
                    scale = 2,
                    format = c("png8", "gif", "jpg", "jpg-baseline", "png32"),
                    maptype = c("terrain","satellite", "roadmap", "hybrid"),
                    language = "en-EN", region, markers, path, visible, style,
                    sensor = FALSE, messaging = FALSE,
                    urlonly = FALSE, filename = "ggmapTemp",
                    color = c("color", "bw"), ...)
{
  #读取字符串
  args &lt;- as.list(match.call(expand.dots = TRUE)[-1])
  argsgiven &lt;- names(args)
  #中心判别
  if ("center" %in% argsgiven) {
    if (!((is.numeric(center) &amp;&amp; length(center) == 2) ||
            (is.character(center) &amp;&amp; length(center) == 1))) {
      stop("center of map misspecified, see ?get_googlemap.",
           call. = F)
    }
    if (all(is.numeric(center))) {
      lon &lt;- center[1]
      lat &lt;- center[2]
      if (lon &lt; -180 || lon &gt; 180) {
        stop("longitude of center must be between -180 and 180 degrees.",
             " note ggmap uses lon/lat, not lat/lon.", call. = F)
      }
      if (lat &lt; -90 || lat &gt; 90) {
        stop("latitude of center must be between -90 and 90 degrees.",
             " note ggmap uses lon/lat, not lat/lon.", call. = F)
      }
    }
  }
  #放大倍数判别
  if ("zoom" %in% argsgiven) {
    if (!(is.numeric(zoom) &amp;&amp; zoom == round(zoom) &amp;&amp; zoom &gt;
            0)) {
      stop("zoom must be a whole number between 1 and 21",
           call. = F)
    }
  }
  #图片尺寸
  if ("size" %in% argsgiven) {
    stopifnot(all(is.numeric(size)) &amp;&amp; all(size == round(size)) &amp;&amp;
                all(size &gt; 0))
  }
  #图片精细度
  if ("scale" %in% argsgiven) {
    stopifnot(scale %in% c(1, 2, 4))
  }
  #标注
  if ("markers" %in% argsgiven) {
    markers_stop &lt;- TRUE
    if (is.data.frame(markers) &amp;&amp; all(apply(markers[, 1:2],
                                            2, is.numeric)))
      markers_stop &lt;- FALSE
    if (class(markers) == "list" &amp;&amp; all(sapply(markers, function(elem) {
      is.data.frame(elem) &amp;&amp; all(apply(elem[, 1:2], 2,
                                       is.numeric))
    })))
      markers_stop &lt;- FALSE
    if (is.character(markers) &amp;&amp; length(markers) == 1)
      markers_stop &lt;- FALSE
    if (markers_stop)
      stop("improper marker specification, see ?get_googlemap.",
           call. = F)
  }
  #折现标注
  if ("path" %in% argsgiven) {
    path_stop &lt;- TRUE
    if (is.data.frame(path) &amp;&amp; all(apply(path[, 1:2], 2,
                                         is.numeric)))
      path_stop &lt;- FALSE
    if (class(path) == "list" &amp;&amp; all(sapply(path, function(elem) {
      is.data.frame(elem) &amp;&amp; all(apply(elem[, 1:2], 2,
                                       is.numeric))
    })))
      path_stop &lt;- FALSE
    if (is.character(path) &amp;&amp; length(path) == 1)
      path_stop &lt;- FALSE
    if (path_stop)
      stop("improper path specification, see ?get_googlemap.",
           call. = F)
  }
  #出现此标识推出
  if ("visible" %in% argsgiven) {
    message("visible argument untested.")
    visible_stop &lt;- TRUE
    if (is.data.frame(visible) &amp;&amp; all(apply(visible[, 1:2],
                                            2, is.numeric)))
      visible_stop &lt;- FALSE
    if (is.character(visible))
      visible_stop &lt;- FALSE
    if (visible_stop)
      stop("improper visible specification, see ?get_googlemap.",
           call. = F)
  }
  #地图类型
  if ("style" %in% argsgiven) {
    message("style argument untested.")
    style_stop &lt;- TRUE
    if (is.character(style) &amp;&amp; length(style) == 1)
      style_stop &lt;- FALSE
    if (style_stop)
      stop("improper style specification, see ?get_googlemap.",
           call. = F)
  }
  if ("sensor" %in% argsgiven)
    stopifnot(is.logical(sensor))
  if ("messaging" %in% argsgiven)
    stopifnot(is.logical(messaging))
  if ("urlonly" %in% argsgiven)
    stopifnot(is.logical(urlonly))
  if ("filename" %in% argsgiven) {
    filename_stop &lt;- TRUE
    if (is.character(filename) &amp;&amp; length(filename) == 1)
      filename_stop &lt;- FALSE
    if (filename_stop)
      stop("improper filename specification, see ?get_googlemap.",
           call. = F)
  }
  if ("checkargs" %in% argsgiven) {
    .Deprecated(msg = "checkargs argument deprecated, args are always checked after v2.1.")
  }
  format &lt;- match.arg(format)
  if (format != "png8")
    stop("currently only the png format is supported.", call. = F)
  maptype &lt;- match.arg(maptype)
  color &lt;- match.arg(color)
  if (!missing(markers) &amp;&amp; class(markers) == "list")
    markers &lt;- plyr:::list_to_dataframe(markers)
  if (!missing(path) &amp;&amp; is.data.frame(path))
    path &lt;- list(path)
  #修改1：开始连接变量
  base_url &lt;- "http://api.map.baidu.com/staticimage?"
  center_url &lt;- if (all(is.numeric(center))) {
    center &lt;- round(center, digits = 6)
    lon &lt;- center[1]
    lat &lt;- center[2]
    #修改4
    paste("center=", paste(lon , lat, sep = ","), sep = "")
  }
  else {
    centerPlus &lt;- gsub(" ", "+", center)
    paste("center=", centerPlus, sep = "")
  }
  zoom_url &lt;- paste("zoom=", zoom, sep = "")
  #修改2,
  #修改为百度长短格式，高度增加20%,用来删除百度标签
  size_url &lt;- paste(paste("height=",size[2]*1.2,sep=""),paste("width=",size[1],sep=""),sep="&amp;")
  scale_url &lt;- if (!missing(scale)) {
    paste("scale=", scale)
  }
  else {
    ""
  }
  format_url &lt;- if (!missing(format) &amp;&amp; format != "png8") {
    paste("format=", format)
  }
  else {
    ""
  }
  maptype_url &lt;- paste("maptype=", maptype, sep = "")
  language_url &lt;- if (!missing(language)) {
    paste("language=", language)
  }
  else {
    ""
  }
  region_url &lt;- if (!missing(region)) {
    paste("region=", region)
  }
  else {
    ""
  }
  markers_url &lt;- if (!missing(markers)) {
    if (is.data.frame(markers)) {
      paste("markers=", paste(apply(markers, 1, function(v) paste(rev(round(v,6)), collapse = ",")), collapse = "|"), sep = "")
    }
    else {
      paste("markers=", markers, sep = "")
    }
  }
  else {
    ""
  }
  path_url &lt;- if (!missing(path)) {
    if (is.list(path)) {
      ps &lt;- sapply(path, function(one_path) {
        paste("path=", paste(apply(one_path, 1, function(v) paste(rev(round(v,6)), collapse = ",")), collapse = "|"), sep = "")
      })
      paste(ps, collapse = "&amp;")
    }
    else {
      paste("path=", path, sep = "")
    }
  }
  else {
    ""
  }
  visible_url &lt;- if (!missing(visible)) {
    if (is.data.frame(visible)) {
      paste("visible=", paste(apply(visible, 1, function(v) paste(rev(round(v,6)), collapse = ",")), collapse = "|"), sep = "")
    }
    else {
      paste("visible=", paste(visible, collapse = "|"),
            sep = "")
    }
  }
  else {
    ""
  }
  style_url &lt;- if (!missing(style)) {
    paste("style=", style)
  }
  else {
    ""
  }
  sensor_url &lt;- paste("sensor=", tolower(as.character(sensor)),
                      sep = "")
  #修改3
  #post_url &lt;- paste(center_url, zoom_url, size_url,sep = "&amp;")
  post_url &lt;- paste(center_url, zoom_url, size_url, scale_url,
                    format_url, language_url, region_url, markers_url,
                    path_url, visible_url, style_url, sep = "&amp;")
  url &lt;- paste(base_url, post_url, sep = "")
  url &lt;- gsub("[&amp;]+", "&amp;", url)
  if (substr(url, nchar(url), nchar(url)) == "&amp;") {
    url &lt;- substr(url, 1, nchar(url) - 1)
  }
  url &lt;- URLencode(url)
  if (urlonly)
    return(url)
  if (nchar(url) &gt; 2048)
    stop("max url length is 2048 characters.", call. = FALSE)
  destfile &lt;- if (format %in% c("png8", "png32")) {
    paste(filename, "png", sep = ".")
  }
  else if (format %in% c("jpg", "jpg-baseline")) {
    paste(filename, "jpg", sep = ".")
  }
  else {
    paste(filename, "gif", sep = ".")
  }
  download.file(url, destfile = destfile, quiet = !messaging,
                mode = "wb")
  message(paste0("Map from URL : ", url))
  message("Google Maps API Terms of Service : &lt;a href="http://developers.google.com/maps/terms" rel="nofollow"&gt;http://developers.google.com/maps/terms&lt;/a&gt;")
  map &lt;- readPNG(destfile)
  #取出来的图切除上下各10%
  #map&lt;-map[,(0.1*size[1]):size[1]]
  map&lt;-map[(0.1*size[2]+1):(size[2]*1.1),,]
  if (color == "color") {
    map &lt;- apply(map, 2, rgb)
  }
  else if (color == "bw") {
    mapd &lt;- dim(map)
    map &lt;- gray(0.3 * map[, , 1] + 0.59 * map[, , 2] + 0.11 *
                  map[, , 3])
    dim(map) &lt;- mapd[1:2]
  }
  class(map) &lt;- c("ggmap", "raster")
  if (is.character(center))
    center &lt;- as.numeric(geocode(center))
  #修改六，发现谷妹度嫂的坐标变换关系不一致
  #我采集了一些点分析百度坐标的变换关系测试，发现度嫂的坐标变换极大可能是平面变换。。。。
  #ll &lt;- center-c(2.3313056/2^zoom * size[2]/2,1.86832416/2^zoom * size[1]/2)
  #ur &lt;- center+c(2.3313056/2^zoom * size[2]/2,1.86832416/2^zoom * size[1]/2)
  ll &lt;- XY2LatLon(list(lat = center[2],lon = center[1] , zoom = zoom),
  #注意以下需要先long后lat
                 -size[1]*5.05/6, -size[2]*5.05/6)
  ur &lt;- XY2LatLon(list(lat = center[2],lon = center[1], zoom = zoom),
                  size[1]*5/6, size[2]*5.07/6)
  attr(map, "bb") &lt;- data.frame(ll.lat = ll[1], ll.lon = ll[2],
                             ur.lat = ur[1], ur.lon = ur[2])
  #修改七
  map&lt;-t(map)
  dim(map)&lt;-c(size[2],size[1])
  map
}
</pre>
              <p>
              </p>
              <p>
               我也正在学习，资料主要是看RgoogleMaps、ggmap相关函数文档，以及自己试着解读他们内部的函数构造。
               <br/>
               目前业余时间正在学习sp包文档，尝试制作GIS地图蒙版
              </p>
              <div class="bbp-signature">
               <p>
                请加加PSN游戏好友。
                <br/>
                PSN:libingfei
                <br/>
                我有理想，我的理想是随时可以玩游戏。
               </p>
              </div>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-407491">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年10月22日 上午5:26
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/158132/#post-407491">
               8 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407491 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-158132 bbp-reply-position-8 user-id-370488 post-407491 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/370488/" rel="nofollow" title="查看earclimate的档案">
               <img src="http://sdn.geekzu.org/avatar/bed5da0112cbf51999921ce7f7ad1808?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/370488/" rel="nofollow" title="查看earclimate的档案">
               earclimate
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               不错。
               <br/>
               可以考虑针对百度地图API打个包，应该很有应用前景。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
           </li>
           <!-- .bbp-body -->
           <li class="bbp-footer">
            <div class="bbp-reply-author">
             作者
            </div>
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-footer -->
          </ul>
          <!-- #topic-158132-replies -->
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 8 个帖子 - 1 到 8（总计 8 个）
           </div>
           <div class="bbp-pagination-links">
           </div>
          </div>
          <div class="bbp-no-reply" id="no-reply-158132">
           <div class="bbp-template-notice">
            <p>
             您必须先登录才能回复该主题。
            </p>
           </div>
          </div>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
       <div class="comments-area" id="comments">
       </div>
       <!-- #comments -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget bbp_widget_login" id="bbp_login_widget-2">
         <h3 class="widget-title">
          登录
         </h3>
         <form action="http://cos.name/cn/wp-login.php" class="bbp-login-form" method="post">
          <fieldset>
           <legend>
            登录
           </legend>
           <div class="bbp-username">
            <label for="user_login">
             用户名:
            </label>
           </div>
           <div class="bbp-password">
            <label for="user_pass">
             密码:
            </label>
           </div>
           <div class="bbp-remember-me">
            <label for="rememberme">
             记住用户名
            </label>
           </div>
           <div class="bbp-submit-wrapper">
            <button class="button submit user-submit" id="user-submit" name="user-submit" tabindex="104" type="submit">
             登录
            </button>
           </div>
           <div class="bbp-login-links">
            <a class="bbp-register-link" href="http://cos.name/cn/wp-login.php?action=register" title="注册">
             注册
            </a>
            <a class="bbp-lostpass-link" href="http://cos.name/cn/wp-login.php?action=lostpassword" title="忘记密码">
             忘记密码
            </a>
           </div>
          </fieldset>
         </form>
        </aside>
        <aside class="widget widget_text" id="text-7">
         <h3 class="widget-title">
          搜索
         </h3>
         <div class="textwidget">
          <form action="http://www.google.com/search" id="bbp-search-form" method="get" onsubmit="Gsitesearch(this)" role="search">
           <div>
           </div>
          </form>
          <form id="bbp-search-form-baidu" onsubmit="g(this)" role="search">
           <div>
           </div>
          </form>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          新鲜事
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/cn/topics/">
             最新帖子
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/popular/">
             最热门主题
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/no-replies/">
             消灭零回复
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          RSS订阅
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/topics/feed/">
             所有主题
            </a>
           </li>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/forums/feed/">
             所有帖子
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
  </div>
 </body>
</html>